<?php
session_start();


$mysql = new SaeMysql();


$userName=$_POST['userName'];
$userPwd=$_POST['userPwd'];

$sql = "SELECT * FROM user where username='".$userName."' and pwd='".$userPwd."'";
$result = $mysql->getData( $sql );

//echo $result;
if($result)
{
    echo"<script>location.href='info3.php';;</script>";
    $_SESSION['username']=$userName;
    //echo $_SESSION['username'];
}else
{
	echo "<script>alert('用户名或密码错误！！！!');history.back();</script>";
}

$mysql->closeDB();
?>